home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-15 | 9.0 KB | 359 lines | [TEXT/sBAY] |
- #
- # MacShell command examples
- #
- # Copyright (c) 1989, 1990 Suick Bay Technologies. All rights reserved.
- #
- # P.O. Box 29202
- # Mpls, MN 55429
- #
- # No parts of this software may be reproduced or stored in a
- # retrieval system or transmitted in any form, or any means,
- # electronic, mechanical, photocopying, recording or otherwise,
- # without the prior written permission of Suick Bay Technologies.
- #
- # Spread the word and not the disk.
- #
- ############ MacShell™ UNIX Commands ############
- #
- # alias - define command alias
- #
- alias dir=ls # make life easier for MS-DOS users
- alias dir # print alias dir
- alias vi=edit # make life easier for UNIX users
- alias chmod=setfile
- alias # print all alias's
- #
- # cal - print calendar
- #
- cal # current month
- cal 2000 # year 2000
- cal 8 2000 # august 2000
- #
- # cat - catenate and print files and/or standard input
- #
- cat ,profile # print contents of .profile to shell output
- cat - # print stdin to stdout
- #
- # cd - change directories
- #
- cd / # move to root
- cd -d # use dialog to set directory
- cd -i 2 # move to directory number 2 (root)
- #
- # cmp - compare files
- #
- cmp file1 file2 # compare files for differences
- #
- # cp - copy files in one of two formats
- #
- cp *.c backup # copy C source files to backup directory
- cp myfile /back # copy myfile to a backup at the root
- #
- # crypt - encode files
- #
- crypt myfile # encrypt myfile, prompt for password
- crypt myfile -p me # encrypt myfile, use 'me' as password
- crypt myfile -s # encrypt myfile in place
-
- #
- # decrypt - decode files
- #
- decrypt myfile # decrypt myfile, prompt for password
- decrypt myfile -p me # decrypt myfile, use 'me' as password
- decrypt myfile -s # decrypt myfile in place
- #
- # date - print time and date
- #
- date # print date and time
- #
- # df - show disk (volume) free space
- #
- df # print disk info
- #
- # diff - differential file compare
- #
- diff file1 file2 # print character differences between files
- diff file1 file2 -h # print all differences between files
- #
- # echo - echo arguments to stdout
- #
- echo free space is $FREEMEM # print heap memory remaining
- #
- # find - find files
- #
- find * -t APPL # find all applications on line.
- find * -t APPL -c sBAY # find MacShell application
- find *.c # find all C source code
- #
- # fgrep - search files for strings
- #
- fgrep long …/*.c # look for 'long' string in all C source files
- fgrep -h me * # look for 'me' in all text files, don't print headers
- #
- # grep - search files for patterns
- #
- grep ?int* …/*.c # look for lines that contain the pattern '?int*'
- #
- # hd - dump files in hex
- #
- hd myfile # print the contents of myfile in a HEX/ASCII format
- hd -n myfile # print the contents of myfile in a HEX format
- hd -r myfile # print the contents of myfile resource fork
- #
- # ls - list files and directories
- #
- ls # list present directory
- ls / # list root directory
- ls //Untitled # list root of volume 'Untitled'
- ls -l # list present directory in long format
- ls -d # list directories in present directory
- #
- # man - prints detailed explanation of a commands function
- #
- man commands # list manual for commands
- man # list man command information
- #
- # mkdir - make directories
- #
- mkdir newdir # make a directory 'newdir'
- #
- # mv - move files in one of two formats
- #
- mv myfile myfile.bak # rename 'myfile' to 'myfile.bak'
- mv *.c /backups # move C source files to '/backup' directory
- #
- # pr - print text files
- #
- pr * # print all TEXT files in present directory
- pr …/*.c -2js # print C source in two columns, use Job and SetUp dialogs
- pr …/*.c -3ls # print in three column landscape mode, use SetUp dialog
- pr * -h # suppress headers from prints
- #
- # pwd - print present working directory path
- #
- pwd # print present working directory
- #
- # rm - remove files
- #
- rm *.c.bak # remove all files with '.c.bak' suffix
- rm 'My Folder' -r # recursively delete all files and folders in and including 'My Folder'
- #
- # rmdir - remove directories
- #
- rmdir 'My Folder' # remove empty folder 'My Folder'
- rmdir -f 'My Folder' # remove non-empty folder 'My Folder'
- #
- # set - set shell variables
- #
- set TODAY=MONDAY # set a shell variable
- set # print all shell variables
- #
- # script - run shell script
- #
- script myscript # run myscript
- script myscript -v # run myscript in verbose mode
- myscript # run myscript
- myscript -v # run myscript in verbose mode
- #
- # size - print the size of data and resource forks
- #
- size myfile # print the size of resource and data forks of 'myfile'
- #
- # sh - open a new shell
- #
- sh # open a new shell window
- #
- # sleep - suspend execution for an interval (Ticks)
- #
- sleep 360 # sleep for 6 seconds
- #
- # touch - update the date last modified of files
- #
- touch …/* # update modification date of all files in a current tree
- #
- # tr - translate characters
- #
- tr [a-Z] [A-Z] # convert all stdin from lowercase to uppercase
- #
- # unalias - undefine command alias
- #
- unalias dir # who needs MS-DOS anyway !
- #
- # unset - unset (remove) shell variables
- #
- unset TODAY # remove shell variable
- #
- # usage - prints a one line explanation of a commands function
- #
- usage unalias # print simple explanation of unalias command
- #
- # wc - count characters, words, and lines in text files
- #
- wc *.h # print counts of header files
- #
- ############ MacShell™ UNIX Extensions ############
- #
- # cpt - copy directories (trees)
- #
- cpt mysrc mybak # copy directory mysrc to mybak
- #
- # mvt - move directories (trees)
- #
- cpt mysrc mybak # rename directory mysrc to mybak
- cpt mysrc /mybak # move directory mysrc to /mybak
- #
- # edit - edit text files
- #
- edit //*/…/*.pas # edit all pascal files online
- #
- # read - read text files
- #
- read doc # read file 'doc'
- #
- #
- ############ MacShell™ Macintosh Commands ############
- #
- # about - open about dialog
- #
- about # display about MacShell dialog
- #
- # addmenu - add or modify a menu
- #
- addmenu Help # add the menu 'Help'
- addmenu Help General # add the item 'General' to 'Help' menu
- addmenu Help General man # add the command 'man' to the item 'General' in the 'Help' menu
- addmenu Help Items # add 'Items' menu item
- #
- # addsubmenu - add a hierarchical menu
- #
- addmenu Help Items submenu Item1 # add submenu to Items, with submenu item Item1
- #
- # clear - erase all shell output
- #
- clear # erase all output in current shell
- #
- # close - close text window
- #
- close *.h # close all C header windows
- #
- # delmenu - remove menu and/or menu items
- #
- delmenu Help Items # delete the 'Items' item from the 'Help' menu
- delmenu Help # delete the 'Help' menu
- #
- # eject - eject and unmount volume
- #
- eject Floppy # eject the volume 'Floppy'
- eject -u Floppy # eject the volume 'Floppy' and unmount it.
- #
- # lsr - list resources
- #
- lsr MacShell -t DLOG # list DLOG resources in MacShell
- #
- # new - open a new shell or edit window (see prefs)
- #
- new # what more can it say ?
- #
- # open - open text files for editing
- #
- open # use open dialog to open files
- open …/*.h # open all C header files in tree
- #
- # pagesetup - open page setup dialog
- #
- pagesetup # open PageSetUp dialog
- #
- # play - play sound files and resources
- #
- play # play the current beep sound
- play //*/…/* -v # play all sounds online, list their file and resource ID
- play myfile -i 200 # play 'snd ' resource 200 in myfile
- #
- # prefs - set MacShell preferences
- #
- prefs # use dialog to set MacShell preferences
- prefs -i # make MacShell case sensitive
- prefs -c KAHL # make TEXT files THINK C files by default
- #
- # print - open print job dialog
- #
- print # open Print Job dialog
- #
- # quit - quit MacShell™
- #
- quit # cause MacShell to quit
- #
- # restart - restart the Macintosh
- #
- restart # call Mac shutdown manager with restart request
- #
- # revert - revert text window to last version saved.
- #
- revert mywindow # revert contents of window 'mywindow'
- #
- # save - save the contents of window to file
- #
- save *.c # save the contents of all open C source windows
- #
- # saveas - save the contents of window to new file
- #
- saveas *.h # prompt user to save header files under new names
- #
- # setfile - set file attributes
- #
- setfile *.crypt -V # make all encrypted files invisible
- setfile backup/* -L # lock all files in backup directory
- setfile …/*.c -c SBAY # make all C source files MacShell Files
- #
- # shutdown - shutdown the Macintosh
- #
- restart # call Mac shutdown manager with shutdown request
- #
- # sound - set sound volume
- #
- sound 0 # turn sound off
- sound 7 # set sound volume at maximum
- sound 7 -s # set sound to maximum, do not play example sound
- #
- #
- ############ MacShell™ Macintosh DevelopmentCommands ############
- #
- #
- # dpb - print directory ParamBlockRec information
- #
- dpb # print ParamBlockRec info for present directory
- dpb mydir # print ParamBlockRec info for directory 'mydir'
- #
- # environ - print information about system environment
- #
- environ # print Macintosh information
- #
- # fpb - print file ParamBlockRec information
- #
- fpb *.c # print ParamBlockRec info for C source files
- #
- # vpb - print volume ParamBlockRec information
- #
- vpb # print ParamBlockRec for current volume
- vpb //Floppy # print ParamBlockRec for volume 'Floppy'
- #
- #
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-